<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
<%@ page  language="java" errorPage="" %>
<%@ page import="java.util.List"%>
<%@ page import="com.webapp.models.FormBean"%>
<%@ page import="java.lang.reflect.*" %>
<%@ page language="java" session="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="custom" uri="GDK/CSE336TAGS" %>

<jsp:useBean id="beanID" scope="application" class="com.webapp.models.FormBean" />
		
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="indexCSE336.css" />

<title>CSE336 - Assignment 2</title>

<style type="text/css">
	/*<![CDATA[*/
	 div.c2 {text-align:center;}
	 span.c1 {font-size:70%}
	 #errors { color:red; margin: 15px; }
	/*]]>*/
</style>
</head>
<body>

<!--  
All the attribute names and values for the session, ServletContext, and request objects,
The names and values of all the request parameters (i.e., form data set),
The names and values of all the http headers, and
The names and values of your bean properties. -->
<h1>Application Information</h1>

<h2>Session Scope</h2>
<table border="1">

<c:forEach var="attr" items="${sessionScope}">
<tr>
	<td><c:out value="${attr.key}"></c:out></td>
	<td><c:out value="${attr.value}"></c:out></td>
</tr>
</c:forEach>
</table>

<h2>Header Values</h2>
<table border="1">

<c:forEach var="attr" items="${headerValues}">
<tr>
	<td><c:out value="${attr.key}"></c:out></td>
	<td><c:out value="${attr.value}"></c:out></td>
</tr>
</c:forEach>
</table>

<h2>Header</h2>
<table border="1">

<c:forEach var="attr" items="${header}">
<tr>
	<td><c:out value="${attr.key}"></c:out></td>
	<td><c:out value="${attr.value}"></c:out></td>
</tr>
</c:forEach>
</table>


<h2>Request Scope/Params</h2>
<table border="1">
<c:forEach items="${requestScope}" var="par">
        <tr><td>Request object name/value : <c:out value="${par.key} - ${par.value}"/></td></tr>
</c:forEach>
</table>


<h2>Application Scope</h2>
<table border="1">

<c:forEach var="attr" items="${applicationScope}">
<tr>
	<td><c:out value="${attr.key}"></c:out></td>
	<td><c:out value="${attr.value}"></c:out></td>
</tr>
</c:forEach>
</table>

<h2>Cookies</h2>
<table border="1">
<c:forEach var="cm" items="${cookie}">
<tr>
<td class="name">${cm.key}</td>
<td>${cm.value.value}</td>
<td>${cm.value.maxAge}</td>
</tr>
</c:forEach>
</table>


<h2>Bean Viewer</h2>
<table border="1">
<% FormBean b = (FormBean)session.getAttribute("FormData");
	List x = b.getList();
	for(int i = 0; i < x.size(); i++) {%>
<tr>
	<td><%=x.get(i)%></td>
</tr>
<% } %>
</table>

<!-- Update is here! -->
<h2>Bean Viewer (UPDATE)</h2>
<table border="1">
	<tr>
		<td>
		<custom:assign5 bean="${FormData}" />
		</td>
	</tr>
</table>

</body>
</html>